/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.nanosl.norg.ent;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Thilina
 */
@Embeddable
public class PersonHasPersonPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "person_NIC")
    private String personNIC;
    @Basic(optional = false)
    @Column(name = "person_NIC1")
    private String personNIC1;
    @Basic(optional = false)
    @Column(name = "relationship_relationship")
    private String relationshipRelationship;

    public PersonHasPersonPK() {
    }

    public PersonHasPersonPK(String personNIC, String personNIC1, String relationshipRelationship) {
        this.personNIC = personNIC;
        this.personNIC1 = personNIC1;
        this.relationshipRelationship = relationshipRelationship;
    }

    public String getPersonNIC() {
        return personNIC;
    }

    public void setPersonNIC(String personNIC) {
        this.personNIC = personNIC;
    }

    public String getPersonNIC1() {
        return personNIC1;
    }

    public void setPersonNIC1(String personNIC1) {
        this.personNIC1 = personNIC1;
    }

    public String getRelationshipRelationship() {
        return relationshipRelationship;
    }

    public void setRelationshipRelationship(String relationshipRelationship) {
        this.relationshipRelationship = relationshipRelationship;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (personNIC != null ? personNIC.hashCode() : 0);
        hash += (personNIC1 != null ? personNIC1.hashCode() : 0);
        hash += (relationshipRelationship != null ? relationshipRelationship.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PersonHasPersonPK)) {
            return false;
        }
        PersonHasPersonPK other = (PersonHasPersonPK) object;
        if ((this.personNIC == null && other.personNIC != null) || (this.personNIC != null && !this.personNIC.equals(other.personNIC))) {
            return false;
        }
        if ((this.personNIC1 == null && other.personNIC1 != null) || (this.personNIC1 != null && !this.personNIC1.equals(other.personNIC1))) {
            return false;
        }
        if ((this.relationshipRelationship == null && other.relationshipRelationship != null) || (this.relationshipRelationship != null && !this.relationshipRelationship.equals(other.relationshipRelationship))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.nanosl.norg.ent.PersonHasPersonPK[ personNIC=" + personNIC + ", personNIC1=" + personNIC1 + ", relationshipRelationship=" + relationshipRelationship + " ]";
    }
    
}
